
$(document).ready(function(){
			//首页轮播
		var i = 0;
		var w = setInterval(function() {
			var $none;
			var $listItem;
			if(i==2){
				$none= $(".banner_ul").children("li:eq(" + i + ")");
				i=0;
				$listItem=$(".banner_ul").children("li:eq(" + i + ")");
			}else{
				$none= $(".banner_ul").children("li:eq(" + i + ")");
				i++;
				$listItem=$(".banner_ul").children("li:eq(" + (i) + ")");
			}
            $none.addClass("banner_img");
			$listItem.removeClass("banner_img");
			$none.fadeOut(1200);
			$listItem.fadeIn(1200);
		}, 3500);

    /**
	 * 城市显示 隐藏
     */
		$('.h5index-search').click(function(){
			$('.g-search-popup').css("display","block");
		});


		$('#cityclose').click(function () {
            $('.g-search-popup').css("display","none");
        });


    $("#place_list li[codeid]").click(function () {
        $("input[name='cityName']").val($(this).text().trim());
        $("input[name='codeId']").val($(this).attr("codeid"));
        $("#serfrom").submit();
    });

    //location的height
    $('.location').css({
        'height': $(window).height()
    })
    mui.init();
    mui.ready(function() {
        var list = document.getElementById('list');
        //calc hieght
        list.style.height = (document.body.offsetHeight) + 'px';
        //create
        window.indexedList = new mui.IndexedList(list);
        $('.mui-placeholder').css({
            'z-index': '-1'
        });
    });

    function other_cities1() {
        //显示地图
        $('#location').show();
        $('#location_box').hide();
        $('#index_page').hide();
        //初始化再次加载
        mui.init();
        mui.ready(function() {
            var list = document.getElementById('list');
            //calc hieght
            list.style.height = (document.body.offsetHeight) + 'px';
            //create
            window.indexedList = new mui.IndexedList(list);
            $('.mui-placeholder').css({
                'z-index': '-1'
            });
        });
        //获取高度作出padding值
        var guild = $('.guild').height();
        console.log(guild);
        $('.location .mui-indexed-list-inner').css({
            'padding-top': guild
        });
        $('.mui-indexed-list-bar a').height('3.85%');
    }
    //获取高度作出padding值
    var guild = $('.guild').height();
    console.log(guild);
    $('.location .mui-indexed-list-inner').css({
        'padding-top': guild
    });

    $('.g-search-popup').css("display","none");
    $.ajax({
        url:"../houses/houseRecom",
        type:"GET",
        dataType:"json",
        success:function(result){
            var houseInf=result.extend.houseList;
            $.each(houseInf,function(index,item) {
                var divList = $("<div class=\"list clearfloat fl box-s\"></div>");
                var a = $("<a href=\"../houses/houseDetails/"+item.houseId+"\"></a>");
                var divImg = $("<div class=\"tu clearfloat\"><span></span><img src=\"../statics/upload/"+item.imgName.split(',')[0]+"\"/></div>");
                var divRight = $("<div class=\"right clearfloat\"></div>");
                var divTitPrice = $("<div class=\"tit clearfloat\"></div>");
                var pTitle = $("<p class=\"fl\">"+item.title+"</p>");
                var spanPrice = $("<span class=\"fr\">"+item.price+"<samp>元/月</samp></span>");
                var pHType = $("<p class=\"recom-jianjie\">"+item.shi+"室"+item.ting+"厅|  "+item.area+"m²  |  "+item.ftypeName+"</p>");
                var divrecombottom = $("<div class=\"recom-bottom clearfloat\">" +
                    "<span><i class=\"iconfont icon-duihao\"></i>随时住</span>" +
                    "<span><i class=\"iconfont icon-duihao\"></i>家电齐全</span></div>");
                divTitPrice.append(pTitle).append(spanPrice);
                divRight.append(divTitPrice).append(pHType).append(divrecombottom);
                a.append(divImg).append(divRight)
                divList.append(a);
                $(".content").append(divList);
            });

        }

    });








});

